import {
	createSSRApp
} from "vue";
import * as Pinia from 'pinia';
import App from "./App.vue";
import "@/static/base.scss"
import "@/static/icon/iconfont.css"
// import 'default-passive-events'
//import Message from "@/pages/components/common/message/Message.js"
import Message from '@/utils/Message';
import Request from '@/utils/Request';
import Api from "@/utils/Api"
import Confirm from "@/utils/Confirm"
import Utils from "@/utils/Utils"

//import Framework from '@/pages/Framework.vue'
import Navbar from "@/pages/components/common/Navbar.vue"
import DataList from '@/pages/components/common/DataList.vue'
import Dialog from '@/pages/components/common/Dialog.vue'
import ShowTips from '@/pages/components/common/ShowTips.vue'
import Popup from '@/pages/components/common/Popup.vue'
import SlidePage from "@/pages/components/common/SlidePage.vue"
import Footer from "@/pages/components/common/Footer.vue"

export function createApp() {
	const app = createSSRApp(App);
	app.config.globalProperties.globalInfo = {
	  avatarUrl: "/api/file/getAvatar/",
	  imageUrl: "/api/file/getImage/",
	};
	app.use(Pinia.createPinia());
	//app.use(Message)

	app.component("Navbar", Navbar)
	app.component("DataList", DataList)
	app.component("Dialog", Dialog)
	app.component("ShowTips", ShowTips);
	app.component("Popup", Popup);
	app.component("SlidePage", SlidePage);
	app.component("Footer", Footer);

	//全局变量
	app.config.globalProperties.Message = Message;
	app.config.globalProperties.Request = Request;
	app.config.globalProperties.Api = Api;
	app.config.globalProperties.Confirm = Confirm;
	app.config.globalProperties.Utils = Utils;
	return {
		app,
	};
}
